# 指定我的工程最低需要使用哪个版本的cmake工具进行配置和编译
cmake_minimum_required(VERSION 3.12)

# 指定工程名字
project(project)


# 指定C编译器，编译器的绝对路径
set(CMAKE_C_COMPILER "/home/book/100ask_imx6ull-sdk/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/bin/arm-buildroot-linux-gnueabihf-gcc" CACHE STRING "Updated variable" FORCE)

# 指定链接器链接的时候，需要链接的库
include_directories("/home/book/100ask_imx6ull-sdk/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/arm-buildroot-linux-gnueabihf/sysroot/usr/include/freetype2")
link_directories("/home/book/100ask_imx6ull-sdk/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/arm-buildroot-linux-gnueabihf/sysroot/usr/lib")
SET(GCC_USER_LINK_FLAGS    "-lm -lfreetype -lpthread -ljpeg") # 自己用到的库链接

# 指定inlcude目录 
include_directories(include) 
include_directories(ui)

# 去指定目录下执行该目录下的cmake配置文件 
add_subdirectory(ui/lvgl) 
add_subdirectory(ui/lv_drivers)

# 设置PAGE变量，然后这个变量会等于 "page/*.c"
file(GLOB_RECURSE PAGE "page/*.c")
file(GLOB_RECURSE TEST_DRV "test/*.c")

add_executable(${PROJECT_NAME} "sys/main.c"  "ui/ui.c" ${PAGE} ${TEST_DRV})

target_link_libraries(${PROJECT_NAME} PRIVATE ${GCC_USER_LINK_FLAGS})
target_link_libraries(${PROJECT_NAME} PRIVATE lvgl lvgl::examples lvgl::drivers) 